package cn.wolfcode.ssm.mapper;

import cn.wolfcode.ssm.domain.Employee;
import cn.wolfcode.ssm.qo.QueryObject;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface EmployeeMapper {
    int deleteByPrimaryKey(Long id);

    int insert(Employee record);

    Employee selectByPrimaryKey(Long id);

    List<Employee> selectAll();

    int updateByPrimaryKey(Employee record);


    List<Employee> selectForResult(QueryObject qo);

    //建立员工与角色之间的关系
    void insertRelation(@Param("eid") Long employeeId, @Param("rid") Long roleId);
    //删除员工与角色之间的关系
    void deleteRelation(Long eid);

    //根据账号和密码查询出员工信息
    Employee selectByUsernameAndPassword(@Param("username") String username,@Param("password") String password);

    //更新密码
    void updatePwd(@Param("newPassword") String newPassword,@Param("id") Long id);

    void batchDelete(Long[] ids);

    Employee selectByName(String name);

    void updateStatus(@Param("status") boolean status,@Param("id") Long id);

    List<Employee> selectByRoleSn(String...sns);

    //void insertBatchRelation(@Param("eid") Long employeeId, @Param("ids") Long[] ids);
}